package com.hopu.v1.service.admin.question.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hopu.v1.mapper.admin.question.QuestionsBanksMapper;
import com.hopu.v1.pojo.common.PageData;
import com.hopu.v1.pojo.question.QuestionsBanks;
import com.hopu.v1.service.admin.question.QuestionsBanksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author YwaiX
 * @description 针对表【t_questions_banks(题库表，存储题库相关信息)】的数据库操作Service实现
 * @createDate 2024-09-26 15:20:06
 */
@Service
public class QuestionsBanksServiceImpl extends ServiceImpl<QuestionsBanksMapper, QuestionsBanks>
        implements QuestionsBanksService {
    
    @Autowired
    private QuestionsBanksMapper questionsBanksMapper;
    
    /**
     * 获取题库列表
     *
     * @param sid
     * @return
     */
    @Override
    public PageData<QuestionsBanks> getQuestionsBankList(Integer page, Integer size, Integer sid,String name,Integer status) {
        Integer total = questionsBanksMapper.count(sid,name,status);
        return new PageData<>(page, size, total, questionsBanksMapper.getQuestionBankList((page - 1) * size, size, sid,name,status));
    }
}




